//
//  Cview.m
//  事件传递
//
//  Created by slience on 2019/12/9.
//  Copyright © 2019 shehuiren. All rights reserved.
//

#import "Cview.h"

@implementation Cview

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


-(BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{
    
    
    return YES;
}

//MARK: - - 如果pointInside 为yes，倒叙遍历该view的所有子试图 找到响应的view
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
    
    for(int i = (int)self.subviews.count - 1 ;i >= 0;i--){
        
        UIView * vc = self.subviews[i];
        
        if ([vc hitTest:point withEvent:event]){
            
            return vc;
        }
    }
    return  nil;
   
}

@end
